package com.jichangxiu.server.platform.entity.map;

import com.jichangxiu.server.platform.entity.dto.PlatformPostQueryDto;
import com.jichangxiu.server.platform.entity.po.PlatformPost;
import com.jichangxiu.server.platform.entity.vo.PlatformPostAddVo;
import com.jichangxiu.server.platform.entity.vo.PlatformPostEditVo;
import com.jichangxiu.server.platform.entity.vo.PlatformPostQueryVo;
import org.mapstruct.Builder;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * PlatformPostBasic:
 *
 * @author Jcx
 * @create 2023-03-19 8:41
 */
@Mapper(builder = @Builder(disableBuilder = true))
public interface PlatformPostBasic {

    public PlatformPostBasic INSTANCE = Mappers.getMapper(PlatformPostBasic.class);

    /**
     * 转换 PlatformPost
     *
     * @param platformPostAddVo 视图对象
     * @return 数据库对象
     */
    public PlatformPost toPlatformPost(PlatformPostAddVo platformPostAddVo);

    /**
     * 转换 PlatformPost
     *
     * @param platformPostEditVo 视图对象
     * @return 数据库对象
     */
    public PlatformPost toPlatformPost(PlatformPostEditVo platformPostEditVo);

    /**
     * 转换 PlatformPost
     *
     * @param platformPostQueryVo 视图对象
     * @return 数据库对象
     */
    public PlatformPost toPlatformPost(PlatformPostQueryVo platformPostQueryVo);

    /**
     * 转换 PlatformPostQueryDto
     *
     * @param platformPost 数据库对象
     * @return 数据传输对象
     */
    public PlatformPostQueryDto toPlatformPostQueryDto(PlatformPost platformPost);

    /**
     * 转换 PlatformPostQueryDto 列表
     *
     * @param platformRoleList 数据库对象列表
     * @return 数据传输对象列表
     */
    public List<PlatformPostQueryDto> toPlatformPostQueryDtoList(List<PlatformPost> platformRoleList);

}
